<?php
class Validation {

    public static function IsValidUsername($str){
        $res = preg_match("/^.{4,16}$/", $str);
        return $res == 1;
    }

    public static function IsValidPassword($str){
        $res = preg_match("/^.{8,16}$/", $str);
        return $res == 1;
    }

    public static function IsValidEmail($str){
        if (strlen($str) > 128)
            return false;
        return preg_match("/^[a-zA-Z0-9\\._-]{2,64}@[a-zA-Z0-9\\._-]{2,64}$/i",$str);
    }
    
}
?>